<style scoped>
    .asklist {
      display: flex;
      flex-direction: column;
      margin-top: 0.88rem;
      font-size: 14px;
      position: relative;
    }
  .ask-list{
    display: flex;
    flex-direction: column;
    width: 100%;
    border-bottom: 1px solid #9B9B9B;
    min-height: 1.8rem;
  }
  .ask-title{
    padding: 0.2rem 0.2rem;
  }
  .ask-data{
    display: flex;
    flex-direction: row-reverse;
    padding-right: 0.4rem;
    padding-bottom: 0.2rem;
  }
  .zanwu{
    width: 2.2rem;
    position: relative;
    margin: 2.2rem auto;
    text-align: center;
  }
  .zanwu img{
    width: 100%;
  }
</style>
<template>
    <div class="asklist">
      <navx></navx>
      <div id="loadingToast" class="weui_loading_toast" v-if="loading">
        <div class="weui_mask_transparent"></div>
        <div class="weui_toast">
          <div class="weui_loading">
            <!-- :) -->
            <div class="weui_loading_leaf weui_loading_leaf_0"></div>
            <div class="weui_loading_leaf weui_loading_leaf_1"></div>
            <div class="weui_loading_leaf weui_loading_leaf_2"></div>
            <div class="weui_loading_leaf weui_loading_leaf_3"></div>
            <div class="weui_loading_leaf weui_loading_leaf_4"></div>
            <div class="weui_loading_leaf weui_loading_leaf_5"></div>
            <div class="weui_loading_leaf weui_loading_leaf_6"></div>
            <div class="weui_loading_leaf weui_loading_leaf_7"></div>
            <div class="weui_loading_leaf weui_loading_leaf_8"></div>
            <div class="weui_loading_leaf weui_loading_leaf_9"></div>
            <div class="weui_loading_leaf weui_loading_leaf_10"></div>
            <div class="weui_loading_leaf weui_loading_leaf_11"></div>
          </div>
          <p class="weui_toast_content">数据加载中</p>
        </div>
      </div>
      <div class="asklist-box"  v-if="asklist.length>0">
        <div class="ask-list" v-for="(item,index) in asklist">
          <div class="ask-title">
            {{index+1}}.{{item.question_text}}
          </div>
          <div class="ask-data">
            {{item.time}}
          </div>
        </div>
      </div>
      <div v-else class="zanwu">
        <img src="../assets/img/zanwu.png">
        <p>暂无提问</p>
      </div>



    </div>
</template>

<script>
    import '../assets/css/weui.css'
    import axios from 'axios'
    import navx from '@/components/navx'
    import Qs from 'qs'
    export default {
        name: '',
        data() {
            return {
              asklist:'',
              loading:true
            }
        }, created() {

        },  components:{
      navx
    },mounted() {
          this.asjx()
        }, methods: {

          asjx:function () {
            var that =this;
            // console.log('12312')
            var data={
              uid:1
            }
            var pa3=Qs.stringify(data);
            axios.post('http://test.jiaoxue.com/question/index/quizList',pa3)
              .then(response => {
                // response=JSON.parse(response)
                // console.log(response.data.code)
                if(response.status==200){
                  that.loading=false
                  that.asklist=response.data.data;
                }else {
                   that.loading=false
                   alert('网络有错，或者参数不合法')
                }
                // console.log(response)
              })
              .catch(function (error) {
                alert('网络错误')
              });
      }
    }
    }
</script>
